Introduction

This visualization created time series plots for all counties of California and the animated map of California for Covid-19 cases. The data used is obtained from the New York Times. I filter the data for California counties only since the main focus of this report is California.

Results

The final result is shown above. The final plot achieved the most desired functions. The viewer can click on every line of the time series plot to highlight and disable it by double clicks. The viewer can use the buttons to hide and show all lines. Both maps and time series plots have detailed hover information.

Discussion

There are still potential improvements for this project. One problem that I have encountered is the initial map of the animation, the animation function from plotly does not support the setting of the initial frame. One easy solution is to deep clone all data from the latest date and add it as the initial frame. However, this is not an ideal solution, since the animation will start at that date and there will always be an initial value in the slider. A better solution is to use the first method mentioned above for the animation and set the active value of the slider to the last date in the data set. Also, it will be ideal, if the viewer can select the county of their interest on the map and have all lines hide except the selected county. This could be achieved by obtaining the county name using js code and then change the “visible” argument to “F” except for the line of selected county.

I have trouble making these work in limited time. Nevertheless, this is a very interesting project, and I would like to continue working on this project. What’s more I would try to find a better solution for the animation with a better base map and try to do this for more states.

Acknowledgment

Examples and documents from plotly website were referenced for this project. url: https://plotly.com/r/